import {get, post,put,del} from "./request";

//学校类型
export const getSchoolType = (param) => get('api/v1/SchoolTypeCustom/getdata',param);

//学校
export const getSchool = (param) => get('api/v1/SchoolCustom/getdata',param);

//班车站点
export const getStopGo = (param) => get(`api/v1/ShuttleStopCustom/getdata_go`,param);  //去程
export const getStopLeave = (param) => get(`api/v1/ShuttleStopCustom/getdata_leave`,param); //回程
export const getStopRoundLeave = (param) => get(`api/v1/ShuttleStopCustom/getdata_round_leave`,param); //往返回程

//班车套票类型
export const getPackage = (param) => get(`api/v1/ShuttlePackageCustom/getdata`,param)

//班车
export const getShuttle = (param) => get(`api/v1/ShuttleCustom/getdata`,param)


//获取客户
export const getCustomer = () => get(`api/v2/Customer/me`)
export const editCustomer = (param) => put(`api/v2/Customer`,[param])

//获取乘车人
export const getPassenger = () => get(`api/v2/Passengers/MyPassengers`)
export const addPassenger = (param) => post(`api/v2/Passengers`,[param])
export const editPassenger = (param) => put(`api/v2/Passengers/${param.passengers_id}`,param)
export const delPassenger = (id) => del(`api/v2/Passengers/${id}`)

//获取订单
export const getOrder = (param) => get(`api/v2/Order/MyOrders`,param)
export const editOrder = (param) => put(`api/v2/Order/${param.out_trade_no}`,param)

//班车套票
export const getShuttlePackage = (param) => get(`api/v2/ShuttlePackage`,param);

//获取证件类型编号
export const getIdentificationType = () => get(`api/v2/IdentificationType`);

//上传文件
export const uploadFile = (file) => post(`api/v1/UpLoad/upload_training_materials_attachments`,file,)

//获取回程接送方式
export const getLeaveSchoolType =(param) => get('api/v2/LeaveSchoolType',param)  //获取下车接送方式

//锁票
export const lockTicket = (param) => post('api/v1/LockTicket/lock_ticket',param)
export const unLockTicket = (id,mark) => post(`api/v1/LockTicket/unlock_ticket?out_trade_no=${id}&mark=${mark}`)
//查询锁票结果
export const getLockResult = (id) =>  get(`api/v1/LockTicket/lock_result?out_trade_no=${id}`)
//微信统单
export const unifiedorder = (id) => post(`api/v1/LockTicket/unifiedorder?out_trade_no=${id}`)
//申请退票、取消申请
export const applyRefund = (id,isRefund,reason) => post(`api/v1/Order/order_apply_refund?out_trade_no=${id}&TF=${isRefund}&Order_refund_reason=${reason}`)
//检查优先购票
export const checkPriorityPassengers = (param) => post('api/v1/EPriorityPassengers/Check_Priority_Passengers',param)
// 检查是否需要签协议
export const checkAgreement = (param) => post(`api/v1/LockTicket/check_second_train_agreement_TF?shuttle_id=${param.shuttle_id}&packag_type_id=${param.packag_type_id}&ticket_typall_id=${param.ticket_typall_id}&passengers_id=${param.passengers_id}`)

//获取系统参数
export const getParameter =(param) => get('api/v2/Parameter',param)  //获取系统参数

//模拟调起微信支付
export const lockTicketTest = (id) => post(`api/v1/LockTicket/lock_ticket_commit?out_trade_no=${id}`)

//获取微信jssdk 参数
export const getWXConfig = (url) => get(`api/v1/LoginWeChat/Get_WX_JSSDK`,{url})
//腾讯地图api
export const mapGeocoder = (param) => post(`api/v3/map/tencent/ws/geocoder/location`,param)

//获取协议
export const getAgreement = (id) => get(`api/v2/AgreementQuery${id ? '/' + id : ''}`)

//提交订单协议图片签名图片
export const updateOrderImg = (param) =>  post(`api/v1/Order/update_order_agreement_pic`,param,)

//查询后付款记录
export const getAfterPayment = (param) => get(`api/v2/AfterPayment`,param)
export const getAfterPaymentDetail = (id) => get(`api/v2/AfterPayment/${id}`)
export const getMyAfterPayment = (param) => get(`api/v2/AfterPayment/MyAfterPayments`,param)
export const afterPay = (param) => post(`api/v1/AfterPayment/after_payment_unifiedorder`,param)


//请假登记
export const getLeaveRegistration = (param) => get(`api/v2/LeaveRegistration`,param);
export const getMyLeaveRegistration = (param) => get(`api/v2/LeaveRegistration/MyLeaveRegistration`,param);
export const addLeaveRegistration = (param) => post(`api/v2/LeaveRegistration`,param)
export const addLeaveRegistrationNoOrder = (param) => post(`api/v2/LeaveRegistration/NoOrder`,param)
export const editLeaveRegistration = (param) => put(`api/v2/LeaveRegistration/${param.row_id}`,param)
export const delLeaveRegistration = (id) => del(`api/v2/LeaveRegistration/${id}`,)


// 231204 liang 获取推文
export const getInfoArticle = (data) => get('api/v2/InfoArtice', data)
// 获取用户信息
export const getUserInfo2 = (data) => post('api/v2/LoginDingtalk/getuserinfo', data)
export const getUserInfo = (data) => post('api/v1/LoginDingtalk/getuserinfo', data)
export const SendVerificationCodeSMS = (data) => post('api/v1/AliyunSMS/SendVerificationCodeSMS', data)
export const SubmitVerificationCode = (data) => post('api/v1/AliyunSMS/SubmitVerificationCode', data)
